Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change log-level cli opt to take a string #2279

Merged
merged 2 commits into from
May 7, 2024
Merged

Conversation

Tristan-Wilson
Copy link
Member

The log-level cli opt on all executables built by this project now takes a string instead of an integer, and the strings are the typical CRIT, ERROR, WARN, INFO, DEBUG, TRACE. Additionally it accepts the old geth numeric log levels as an undocumented feature to avoid the need for anyone already using them to migrate their config.

The introduction of slog as geth's logger changed the numeric constants used for the typical levels, so we make this change to avoid requiring any config changes and also to give clearer options going forward.

Testing done

Tried out nitro and daserver using both quoted and non-quoted numeric values for log-level and the string values, and with both json file config and command line. Also checked that they quit with an error if an invalid string is used.

@cla-bot cla-bot bot added the s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA. label May 7, 2024
The log-level cli opt on all executables built by this project now takes
a string instead of an integer, and the strings are the typical
CRIT, ERROR, WARN, INFO, DEBUG, TRACE. Additionally it accepts the old
geth numeric log levels as an undocumented feature to avoid the need for
anyone already using them to migrate their config.

The introduction of slog as geth's logger changed the numeric constants
used for the typical levels, so we make this change to avoid requiring any
config changes and also to give clearer options going forward.
Copy link
Contributor

@ganeshvanahalli ganeshvanahalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Tristan-Wilson Tristan-Wilson merged commit 5c06be7 into master May 7, 2024
9 checks passed
@Tristan-Wilson Tristan-Wilson deleted the fix-log-level-opt branch May 7, 2024 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants